import Vue from 'vue'
import Vuex from 'vuex'
import createVuexAlong from 'vuex-along'


import setTing from '../appSetting.js'
Vue.use(Vuex)
// import routers from './navSlider.js'
// import getters from './getters.js'
import header from './module/header.js' // 用户头部操作模块
import company from './module/company.js' // 公司名称和id
import user from './module/user.js' // 用户数据模块\
//通讯录
import addressList from './module/addressList/addressList.js' // 组织架构和角色之间的切换
import navState from './module/addressList/navState.js' // 通讯录，我的管理模块，左部导航栏状态
// 产业工人
import industrialis from './module/industrialis/industrialis.js' // 产业工人
const store  = new Vuex.Store({
	state: {
		setTing
	},
	modules: {
		user,
		header,
		company,
		addressList,
		navState,
		industrialis
	},
	// getters,
	plugins: [createVuexAlong({
		name: 'appSession',
		local: {
			list: ['header', 'user', 'setTing', 'addressList', 'navState', 'company', 'industrialis'],
			// 过滤模块 header 数据， 将其他的存入 localStorage
			isFilter: true,
		  },
		session: {
			list: ['header', 'user', 'addressList', 'navState', 'company', 'industrialis']
		}
	})]





	// state: {
	// 	// routers: routers,
	// 	layOutSetTing: setTing,
	// 	lowerIsShow: false
	// },
	// mutations: {},
	// actions: {},
	// modules: {}
})

export default store
